package UI;
import facecat.topin.grid.FCGrid;
import facecat.topin.grid.FCGridRow;
import facecat.topin.core.*;
import java.util.ArrayList;

public class GridRowEx extends FCGridRow {
    public GridRowEx()
    {
        setHeight(25);
    }

    public void onPaint(FCPaint paint, FCRect clipRect, boolean isAlternate)
    {
        FCGrid grid = getGrid();
        ArrayList<FCGridRow> rows = grid.getSelectedRows();
        int rowsSize = rows.size();
        FCRect bounds = getBounds();
        int scrollH = 0, scrollV = 0;
        if (grid.getHScrollBar() != null && grid.getHScrollBar().isVisible())
        {
            scrollH = grid.getHScrollBar().getPos();
        }
        if (grid.getVScrollBar() != null && grid.getVScrollBar().isVisible())
        {
            scrollV = grid.getVScrollBar().getPos();
        }
        bounds.left = 1;
        bounds.top -= scrollV;
        bounds.right = bounds.right - bounds.left;
        bounds.bottom -= scrollV;
        if (rowsSize > 0)
        {
            if (rows.contains(this))
            {
                paint.fillRect(MyColor.USERCOLOR219, bounds);
            }
            else
            {
                if (isAlternate)
                {
                    if (MyColor.m_style == 0)
                    {
                        paint.fillRect(FCColor.rgb(28, 28, 28), bounds);
                    }
                    else
                    {
                        paint.fillRect(FCColor.rgb(240, 240, 240), bounds);
                    }
                }
            }
        }
    }
}
